home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ShutDown.h
-
- Copyright: © 1984-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
-
- #ifndef __SHUTDOWN__
- #define __SHUTDOWN__
-
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- /* #include <ConditionalMacros.h> */
-
- #ifndef __MIXEDMODE__
- #include <MixedMode.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if GENERATINGPOWERPC
- #pragma options align=mac68k
- #endif
-
- #ifdef __CFM68K__
- #pragma lib_export on
- #endif
-
-
- enum {
- sdOnPowerOff = 1, /*call procedure before power off.*/
- sdOnRestart = 2, /*call procedure before restart.*/
- sdOnUnmount = 4, /*call procedure before unmounting.*/
- sdOnDrivers = 8, /*call procedure before closing drivers.*/
- sdRestartOrPower = 3 /*call before either power off or restart.*/
- };
-
- /*
- ShutDwnProcPtr uses register based parameters on the 68k and cannot
- be written in or called from a high-level language without the help of
- mixed mode or assembly glue.
-
- In:
- => shutDownStage D0.W
- */
-
- #if GENERATINGCFM
- typedef UniversalProcPtr ShutDwnUPP;
- #else
- typedef Register68kProcPtr ShutDwnUPP;
- #endif
-
- enum {
- uppShutDwnProcInfo = kRegisterBased
- | REGISTER_ROUTINE_PARAMETER(1, kRegisterD0, SIZE_CODE(sizeof(short)))
- };
-
- #if GENERATINGCFM
- #define NewShutDwnProc(userRoutine) \
- (ShutDwnUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppShutDwnProcInfo, GetCurrentArchitecture())
- #else
- #define NewShutDwnProc(userRoutine) \
- ((ShutDwnUPP) (userRoutine))
- #endif
-
- #if GENERATINGCFM
- #define CallShutDwnProc(userRoutine, shutDownStage) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppShutDwnProcInfo, (shutDownStage))
- #else
- /* (*ShutDwnProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
- #endif
-
- extern pascal void ShutDwnPower(void)
- THREEWORDINLINE(0x3F3C, 0x0001, 0xA895);
- extern pascal void ShutDwnStart(void)
- THREEWORDINLINE(0x3F3C, 0x0002, 0xA895);
- extern pascal void ShutDwnInstall(ShutDwnUPP shutDownProc, short flags)
- THREEWORDINLINE(0x3F3C, 0x0003, 0xA895);
- extern pascal void ShutDwnRemove(ShutDwnUPP shutDownProc)
- THREEWORDINLINE(0x3F3C, 0x0004, 0xA895);
-
- #ifdef __CFM68K__
- #pragma lib_export off
- #endif
-
- #if GENERATINGPOWERPC
- #pragma options align=reset
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __SHUTDOWN__ */
-